import { setDefaultScriptManagePage } from './api'
import { ElMessage, ElMessageBox } from 'element-plus'
import CustomerInspection from './components/CustomerInspection.vue'
import { dialog } from '@/utils/dialog'

export async function setDefault(ctx) {
  const row = ctx.props.row
  await ElMessageBox.confirm(`是否确定设置默认？`, '提示')
  setDefaultScriptManagePage({
    ruleId: row.ruleId,
  }).then(() => {
    ElMessage.success('操作成功')
    ctx._c.dispatch('ListPage', 'getData')
  })
}

export async function customerInspection({ props }) {
  await dialog(CustomerInspection, { title: '客服检测', modalClass: 'custom-dialog' }, { ruleId: props.row?.ruleId })
}
